package ua.com.stormlabs.tiny.licenseserver.utils;

import ua.com.stormlabs.tiny.licenseserver.beans.User;

import java.util.Comparator;

/**
 * @author Maxim Bondarenko
 * @version 1.0 1/14/12
 */

public class UsersIdComparator implements Comparator<User> {
    @Override
    public int compare(User o1, User o2) {
        int user1Id = o1.getId();
        int user2Id = o2.getId();

        if (user1Id < user2Id) {
            return -1;
        } else if (user1Id > user2Id) {
            return 1;
        } else {
            return 0;
        }
    }
}
